jsx3.Class.defineClass(
        "tibco.admin.monitormanage.uicomponents.page.deployment.tabContent.services.Services", //the full name of the class to create
        jsx3.lang.Object, //  extends
        [tibco.admin.monitormanage.uicomponents.page.deployment.ServiceUnitTabInterface], // implements
        function (plugin) {
        
            plugin.instance = null
            plugin.prototype.serviceUnitId;
            plugin.getInstance = function(args) {
                if(!this.instance) {
                    this.instance = new tibco.admin.monitormanage.uicomponents.page.deployment.tabContent.services.Services();
                }
                return this.instance;
            }

            plugin.prototype.getNamespace = function() {
               return "tibco.admin";
            }
            
            plugin.prototype.getTabText = function() {
				return tibco.admin.Main.getServer().getDynamicProperty("@MM@general@ServicesTitle");
            	//return "Services";
            }
             plugin.prototype.updateComponent = function(serviceUnitId, serviceUnitType) {
                 this.serviceUnitId= serviceUnitId;
		 //jsx3.log("ServiceUnit services tab with serviceUnitId = " + serviceUnitId + " and type = " + serviceUnitType);
            }

            plugin.prototype.loadComponent = function(parent) {
                var servicesBlock = tibco.admin.Main.loadUIResource(parent, this.getNamespace(), "tibco/admin/monitormanage/uicomponents/page/deployment/tabContent/services/components/services.xml", true);
                
                var contentBlock = servicesBlock.getDescendantOfName("servicesContentBlock");
        		if(!tibco.admin.monitormanage || !tibco.admin.monitormanage.uicomponents || !tibco.admin.monitormanage.uicomponents.table || !tibco.admin.monitormanage.uicomponents.table.services || !tibco.admin.monitormanage.uicomponents.table.services.Services)
                { tibco.admin.Main.loadClass("tibco/admin/monitormanage/uicomponents/table/services/Services.js", this.getNamespace()); }
				var screenId = tibco.admin.monitormanage.uicomponents.page.deployment.Deployment.serviceUnitScreenId;
                var serviceTable=tibco.admin.Main.loadUIResource(contentBlock, this.getNamespace(), "tibco/admin/monitormanage/uicomponents/table/services/components/services.xml", true);
                serviceTable.setServiceUnitId( this.serviceUnitId);
                serviceTable.setUpComponent("_MM_dply", screenId, false);
                tibco.admin.monitormanage.general.PollingHandler.register(tibco.admin.monitormanage.general.PollingHandler.GENERAL_POLLING_HANDLER_ID, serviceTable, serviceTable.updateComponentForDeployment, screenId);
                tibco.admin.monitormanage.general.RefreshHandler.register(serviceTable, serviceTable.updateComponentForDeployment, screenId);
            }
            

            
            plugin.prototype.tabClicked = function(objEvent) {
            	tibco.admin.monitormanage.uicomponents.dropdown.timeframe.Timeframe.showTimeframe(tibco.admin.monitormanage.uicomponents.page.deployment.Deployment.serviceUnitScreenId);
        	}

        });